<template>
  <div class="loading">
    <p class="text">荒の小屋<br />打铁要趁热，页面请稍等</p>
    <div class="container">
      <div class="bg"></div>
      <div class="arm-left"></div>
      <div class="blacksmith">
        <div class="shape">
          <div class="dress"></div>
          <div class="dress"></div>
        </div>
        <div class="head">
          <div class="moustache"></div>
          <div class="moustache"></div>
          <div class="eye"></div>
        </div>
        <div class="arm-right">
          <div class="hammer"></div>
        </div>
      </div>
      <div class="sword">
        <div class="handle"></div>
      </div>
      <div class="anvil"></div>
      <div class="fire-box">
        <div class="fire"></div>
        <div class="fire"></div>
        <div class="fire"></div>
        <div class="fire"></div>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.loading {
  background-color: #ba4828;
  font-family: 'Concert One', cursive;
  margin: 0;
  overflow: hidden;
  padding: 0;
  width: 100vw;
  height: 100vh;
}

/*/////////////////// rules */
/*/////////////////// scene */
.text {
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  font-size: 5em;
  margin: 0;
  opacity: 0.3;
  text-align: center;
  top: 50px;
  width: 80%;
}

.container {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 400px;
  width: 400px;
}
.container .bg {
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  background-color: rgba(255, 86, 86, 0.2);
  border-radius: 50%;
  bottom: -5px;
  height: 450px;
  width: 450px;
}
.container .bg:after {
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  background-color: rgba(255, 86, 86, 0.2);
  border-radius: 50%;
  bottom: 0;
  content: '';
  height: 350px;
  width: 350px;
}

.arm-left {
  position: absolute;
  background-color: #ca906f;
  border-radius: 80px;
  height: 160px;
  left: 40px;
  top: 190px;
  transform: rotate(30deg);
  width: 60px;
}
.arm-left:after {
  position: absolute;
  background-color: #ca906f;
  border-radius: 50%;
  content: '';
  height: 80px;
  left: -10px;
  top: -40px;
  width: 80px;
}

.blacksmith {
  position: absolute;
  bottom: 0;
  height: 300px;
  left: 50%;
  transform-origin: center;
  transform: translateX(-50%) rotate(0);
  width: 300px;
}
.blacksmith .shape {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: #eab08c;
  border-radius: 50%;
  height: 250px;
  overflow: hidden;
  width: 250px;
}
.blacksmith .shape:after {
  content: '';
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: #777a7a;
  border-radius: 50%;
  height: 200%;
  top: 130%;
  width: 200%;
}
.blacksmith .shape .dress {
  position: absolute;
  background-color: #777a7a;
  height: 100px;
  top: 0;
  width: 20px;
}
.blacksmith .shape .dress:after,
.blacksmith .shape .dress:before {
  position: absolute;
  border: 5px solid #a0a0a0;
  box-sizing: border-box;
  border-radius: 50%;
  content: '';
  height: 30px;
  left: -5px;
  top: 75px;
  width: 30px;
  z-index: 1;
}
.blacksmith .shape .dress:nth-child(1) {
  left: 50px;
}
.blacksmith .shape .dress:nth-child(2) {
  right: 50px;
}
.blacksmith .head {
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  background-color: #13242c;
  border-radius: 50px;
  height: 200px;
  top: -20px;
  width: 90px;
}
.blacksmith .head:after,
.blacksmith .head:before {
  content: '';
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  background-color: #13242c;
  border-radius: 10px;
  height: 20px;
  transform-origin: bottom;
  top: -10px;
  width: 7px;
}
.blacksmith .head:after {
  transform: rotate(20deg);
}
.blacksmith .head:before {
  transform: rotate(-20deg);
}
.blacksmith .head .eye {
  position: absolute;
  background-color: #777a7a;
  box-shadow: 28px 0px 0px #777a7a;
  border-radius: 50%;
  height: 30px;
  left: 10px;
  top: 50px;
  width: 30px;
}
.blacksmith .head .eye:after,
.blacksmith .head .eye:before {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 5px solid #a0a0a0;
  border-radius: 50%;
  box-sizing: border-box;
  content: '';
  height: 100%;
  width: 100%;
}
.blacksmith .head .eye:before {
  left: 43px;
}
.blacksmith .head .moustache {
  position: absolute;
  background-color: #777a7a;
  height: 30px;
  top: 70px;
  width: 35px;
}
.blacksmith .head .moustache:nth-child(1) {
  border-radius: 0 60%;
  left: 40px;
}
.blacksmith .head .moustache:nth-child(2) {
  border-radius: 60% 0;
  left: 5px;
}
.blacksmith .arm-right {
  position: absolute;
  background-color: #eab08c;
  border-radius: 50px;
  height: 170px;
  left: 230px;
  top: 60px;
  transform-origin: 30px 30px;
  transform: rotate(160deg);
  width: 60px;
}
.blacksmith .arm-right:after {
  position: absolute;
  background-color: #eab08c;
  border-radius: 50%;
  content: '';
  height: 80px;
  left: -10px;
  width: 80px;
}
.blacksmith .arm-right .hammer {
  position: absolute;
  background-color: #444444;
  border-radius: 50% 0 0 0;
  height: 60px;
  left: -50px;
  top: 140px;
  transform: rotate(-30deg);
  width: 50px;
  z-index: 1;
}
.blacksmith .arm-right .hammer:after {
  content: '';
  position: absolute;
  background-color: #666666;
  border-radius: 10px;
  height: 10px;
  left: -5px;
  top: 52px;
  width: 60px;
}
.blacksmith .arm-right .hammer:before {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: #666666;
  border-radius: 0 10px 10px 0;
  height: 10px;
  left: 100%;
  width: 30px;
}

/* /.blacksmith */
.anvil {
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  background-color: #444444;
  bottom: 25px;
  height: 50px;
  width: 120px;
}
.anvil:after {
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  content: '';
  border-color: transparent transparent #444 transparent;
  border-style: solid;
  border-width: 0 50px 60px 50px;
  bottom: -25px;
  height: 0;
  width: 0;
}
.anvil:before {
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  background-color: #666666;
  content: '';
  border-radius: 10px;
  height: 10px;
  width: 140px;
}

.sword {
  position: absolute;
  background-color: silver;
  bottom: 75px;
  height: 15px;
  left: 40px;
  width: 200px;
}
.sword:after {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(19, 36, 44, 0.15);
  border-radius: 5px;
  content: '';
  height: 5px;
  left: 20px;
  width: 170px;
}
.sword .handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: #444444;
  border-radius: 10px;
  height: 30px;
  width: 10px;
}
.sword .handle:after {
  position: absolute;
  background-color: rgba(255, 86, 86, 0.9);
  border-radius: 10px 0 0 10px;
  content: '';
  height: 15px;
  left: 80px;
  top: 8px;
  width: 120px;
}
.sword .handle:before {
  position: absolute;
  border-color: transparent transparent transparent #ff5656;
  border-style: solid;
  border-width: 7.5px 0 7.5px 15px;
  content: '';
  height: 0;
  left: 200px;
  opacity: 0.9;
  top: 8px;
  width: 0;
}

.fire-box {
  position: absolute;
  height: 100px;
  left: 130px;
  overflow: hidden;
  top: 225px;
  width: 140px;
}
.fire-box .fire {
  position: absolute;
  background-color: #ff5656;
  border-radius: 20px;
  box-shadow: 0 -5px 30px #ffb256;
  height: 100px;
  width: 30px;
}
.fire-box .fire:after {
  content: '';
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  background-color: #ffb256;
  border-radius: 10px 10px 0 0;
  height: 70px;
  top: 10px;
  width: 15px;
}
.fire-box .fire:nth-child(1) {
  left: 10px;
}
.fire-box .fire:nth-child(2) {
  left: 40px;
}
.fire-box .fire:nth-child(3) {
  left: 70px;
}
.fire-box .fire:nth-child(4) {
  left: 100px;
}

/*/////////////////// animation */
.blacksmith {
  animation: blacksmith-anima 1.5s infinite cubic-bezier(0.59, 0.01, 0.99, 0.22);
}

@keyframes blacksmith-anima {
  0% {
    transform: translateX(-50%) rotate(0);
  }
  50% {
    transform: translateX(-50%) rotate(-10deg);
  }
}
.arm-right {
  animation: arm-anima 1.5s infinite cubic-bezier(0.59, 0.01, 0.99, 0.22);
}

@keyframes arm-anima {
  0% {
    transform: rotate(160deg);
  }
  50% {
    transform: rotate(30deg);
  }
  60% {
    transform: rotate(30deg);
  }
  80% {
    transform: rotate(30deg);
  }
  100% {
    transform: rotate(160deg);
  }
}
.arm-left:after {
  animation: arm-left-anima 1.5s infinite cubic-bezier(0.59, 0.01, 0.99, 0.22);
}

@keyframes arm-left-anima {
  0% {
    top: -40px;
  }
  50% {
    top: -10px;
  }
}
.fire {
  animation: fire-anima 1.5s infinite cubic-bezier(0.59, 0.01, 0.99, 0.22);
}

@keyframes fire-anima {
  0% {
    top: 130px;
  }
  50% {
    top: 130px;
  }
  52% {
    top: 30px;
  }
  70% {
    top: 30px;
  }
  90% {
    top: 130px;
  }
  100% {
    top: 130px;
  }
}
.fire:nth-child(2) {
  animation-delay: 0.05s;
}

.fire:nth-child(3) {
  animation-delay: 0.08s;
}

/*/////////////////////// credit ////*/
#link {
  bottom: 20px;
  color: #000;
  opacity: 0.5;
  display: flex;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

#link p {
  margin: 0;
  margin-left: 5px;
}

#link:hover {
  opacity: 1;
}
</style>
